package com.zenithmind.disk.pojo.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zenithmind.common.base.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(name = "管理用户分享的文件信息实体", description = "管理用户分享的文件信息实体")
public class Share extends BaseEntity {


    @Schema(description = "用户ID，关联users表")
    private String userId;


    @Schema(description = "文件ID，关联files表")
    private String fileId;


    @Schema(description = "分享码，用于访问分享链接")
    private String shareCode;


    @Schema(description = "分享链接")
    private String shareUrl;


    @Schema(description = "分享过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expireTime;


    @Schema(description = "访问次数")
    private Integer accessCount;


    @Schema(description = "是否公开，0表示私密，1表示公开")
    private Integer isPublic;


    @Schema(description = "私密分享时的访问密码")
    private String password;


    @Schema(description = "分享状态，1正常，其他值表示已失效等")
    private Integer status;


}
